<template>
    <div>
        <h2>房间详情</h2>
        <table class="table table-bordered">
            <tbody>
                <tr>
                <td align="right">已排</td>
                <td>{{ queryInfo3.yiPai}}</td>
            </tr>
            <tr>
                <td align="right">未排</td>
                <td>{{ queryInfo3.weiPai}}</td>
            </tr>
            <tr>
                <td align="right">房型外键</td>
                <td>

                    <span v-if="queryInfo3.paiRoomTypeId==2">大床房</span>
                    <span v-if="queryInfo3.paiRoomTypeId==3">双人床</span>
                    <span v-if="queryInfo3.paiRoomTypeId==4">三人床</span>
                    <span v-if="queryInfo3.paiRoomTypeId==5">四人床</span>
                </td>
            </tr>
            <tr>
                <td align="right">房号外键</td>
                <td>
                    <span v-if="queryInfo3.roomNumberId==2">1001</span>
                    <span v-if="queryInfo3.roomNumberId==3">1002</span>
                    <span v-if="queryInfo3.roomNumberId==4">1003</span>
                    <span v-if="queryInfo3.roomNumberId==5">102</span> 
                    <span v-if="queryInfo3.roomNumberId==6">103</span> 
                    <span v-if="queryInfo3.roomNumberId==7">104</span> 
                    <span v-if="queryInfo3.roomNumberId==8">1005</span> 
                </td>
            </tr>
            <tr>
                <td align="right">状态</td>
                <td>{{ queryInfo3.state==1?"上架":"下架"}}</td>
            </tr>
           
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import {ref,reactive,onMounted} from 'vue'
import { useRoute,useRouter } from 'vue-router';
import axios from 'axios';
let route=useRoute();
let router=useRouter();
let queryInfo3=reactive({
    
  yiPai: "",
  weiPai: "",
  paiRoomTypeId: 0,
  roomNumberId: 0,
  state: 0,
  id:route.query.id
})
onMounted(()=>{
    GetRoomList()
})
const GetRoomList=()=>{
    axios({
        url:'/api/PaiRoom/GetPaiRoomId',
        method:'get',
        params:{ id:route.query.id}
    })
    .then((res)=>{
        queryInfo3.yiPai=res.data.yiPai;
        queryInfo3.weiPai=res.data.weiPai;
        queryInfo3.paiRoomTypeId=res.data.paiRoomTypeId;
        queryInfo3.roomNumberId=res.data.roomNumberId;
        queryInfo3.state=res.data.state;
    })
}
</script>

<style scoped>

</style>